#include <copydir.h>

void mkdir_file(char *path) {
	//判断目录是否存在
	if (access(path,F_OK) == 0) {
		return;
	}
	if (mkdir(path, 0777) == -1) {
		perror("mkdir");
		exit(1);
	}
	FILE *f = fopen("./pro_copy.log","a+");
	time_t rawtime;
	struct tm *timeinfo;
	timeinfo = localtime(&rawtime);
	fprintf(f,"\007The current date/time is:%s\n",asctime(timeinfo));
	fprintf(f,"mkdir %s\n",path);
	fclose(f);
}
